//
//  SuModelTool.m
//  CityList
//
//  Created by subook on 16/7/25.
//  Copyright © 2016年 SU. All rights reserved.
//

#import "SuModelTool.h"

@implementation SuModelTool


+ (void)createModelWithDictionary:(NSDictionary *)dict setModelName:(NSString *)modelName {
    
    
    printf("\n@interface %s :NSObject\n",modelName.UTF8String);
    
    for (NSString *key in dict) {
        
        NSString *type = @"NSString";
        
        if ([dict[key] isKindOfClass:[NSNumber class]]) {
            
            type = @"NSNumber";
        }
        if ([dict[key] isKindOfClass:[NSDictionary class]]) {
            
            type = @"NSDictionary";
        }
        if ([dict[key] isKindOfClass:[NSArray class]]) {
            
            type = @"NSArray";
        }
        
        printf("@property (nonatomic,copy) %s *%s;\n",type.UTF8String,key.UTF8String);
        
    }
    
    printf("@end\n");
}

@end
